package com.github.nuggets.controller.api;

import com.github.nuggets.entity.Account;

import com.github.nuggets.service.AccountManagerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description:
 * @author: wangsj
 * @date: 2022/3/16 3:24 下午
 */
@RestController
@RequestMapping(("api/account"))
public class AccountApi {

    @Autowired
    private AccountManagerService accountManagerService;

    @GetMapping("{userName}")
    Account getUser(@PathVariable("userName") String userName){

        return accountManagerService.findAccount(userName);
    }
}
